<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Fetch：跨源请求</title>
	</head>
	<body>
		<!-- img script form 都不受 “同源策略” 限制 -->

		<script>
			;(async () => {
				try {
					await fetch('http://example.com')
				} catch (error) {
					console.log(err) // 跨源请求（报错）
				}
			})()
		</script>
	</body>
</html>
